package com.wangtianxiang.rabbitmq.config;


import com.wangtianxiang.rabbitmq.constants.RabbitMqConfigConstants;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Scope;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Scope("refresh")
@ConfigurationProperties(value = RabbitMqConfigConstants.CONFIG_PREFIX,ignoreInvalidFields = true)
public class DynamicRabbitProperties {
    private boolean enabled;
    private Map<String, CusRabbitProperties> dataSources = new ConcurrentHashMap<>();

    public boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public Map<String, CusRabbitProperties> getDataSources() {
        return dataSources;
    }

    public void setDataSources(Map<String, CusRabbitProperties> dataSources) {
        this.dataSources = dataSources;
    }
}
